import axios from "axios";

//eslint-disable-next-line
export default {
    // 新增子类型
    add: ({ title, _id }) =>
        axios.post('/api/labels/add', {
            title, _id
        })
            .then(({ data }) => data),
    // 获取所有子类型
    getAll: ({ curPage, eachPage }) =>
        axios.get('/api/labels/getAll', {
            params: { curPage, eachPage }
        })
            .then(({ data }) => data),
    // 删除子类型
    del: ({ _id, labelId }) =>
        axios.delete(`/api/labels/del`, {
            params: { labelId, _id }
        })
            .then(({ data }) => data),
    // 获取_id对应的子类型
    getOne: ({ _id }) =>
        axios.get('/api/labels/getOne', {
            params: { _id }
        })
            .then(({ data }) => data),


}